/*
* @Author: dengjiayao
* @Date:   2017-04-18 14:12:16
* @Last Modified by:   dengjiayao
* @Last Modified time: 2017-05-03 10:17:09
*/

import Vue from '../vue'
import store from '../vuex/store'
import loginCheck from '../util/login-check'
import { alert } from 'vue-strap'

import QuestionList from './question-list/question-list.vue'
import QuestionConfig from './question-config/question-config.vue'

new Vue({
  el: 'body',
  components: {
    'vue-alert-msg': alert,
    'vue-question-list': QuestionList,
    'vue-question-config': QuestionConfig
  },
  store,
  created() {
    loginCheck(this)
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  },
  methods: {
    newQuestion() {
      var modal = this.$refs.questionConfig
      modal.actionType = 'CREATE'
      modal.form = {
        questionType: 1,
        question: '',
        answerType: 3,
        answerId: '',
        answerContent: ''
      }
      modal.showModal = true
    }
  }
})
